<?php
/**
 * 
 */
$arr= [4,543,5,[543,5,45,45,4],[45,34,5345]];
$s=0;

function sumArray($value,$key){
	global $s;
	$s=$s+$value;
}
array_walk_recursive($arr,"sumArray");
echo $s;
?>